/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-11-30
 * Time: 18:53
 */
import java.util.*;

public class Demo1 {

    public static boolean fly(int year) {
        return (year % 100 != 0 && year % 4 == 0) || (year % 400 == 0);
    }

    public static int isprofit(int year) {
        return  2 * 31
                +1 * 28
                +1 * 31
                +2 * 30
                +1 * 31
                +2 * 30
                +1 * 31
                +2 * 31
                +2 * 30
                +2 * 31
                +1 * 30
                +2 * 31
                +(fly(year) ? 1 : 0);

    }

    public static int  profitYear(int year,int month,int day) {
        int sum = 0;
        if(isprim(month)) {
            sum = day;
        }else {
            sum += day * 2;
        }

        while(--month > 0) {
            switch(month) {
                case 1:
                case 8:
                case 10:
                case 12:
                    sum += 2 * 31;
                    break;
                case 4:
                case 6:
                case 9:
                    sum += 2 * 30;
                    break;
                case 3:
                case 5:
                case 7:
                    sum+=31;
                    break;
                case 11:
                    sum += 30;
                    break;
                default:
                    if(isprim(year)) {
                        sum+=29;
                    }else {
                        sum+=28;
                    }
                    break;
            }
        }

        return sum;
    }

    public static boolean isprim(int month) {
        return month == 2 || month == 3 || month == 5 || month == 7 || month == 11;
    }

    public static void main(String[] args) {
        int year1,month1,day1,year2,month2,day2;
        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()) {
            year1 = scan.nextInt();
            month1 = scan.nextInt();
            day1 = scan.nextInt();
            year2 =scan.nextInt();
            month2 = scan.nextInt();
            day2 =scan.nextInt();

            int profit = isprofit(year1) - profitYear(year1,month1,day1-1);

            profit += profitYear(year2,month2,day2);

            if(year1 == year2) {
                profit -= isprofit(year1);
            }

            for(int i = year1 + 1; i < year2; i++) {
                profit += isprofit(i);
            }

            System.out.println(profit);
        }
    }
}
